home *** CD-ROM | disk | FTP | other *** search
/ Java Primer Plus / Java Primer Plus (Waite Group Proess)(1996).iso / java_Win / demo / SimpleGraph / GraphApplet.class (.txt) < prev    next >
Encoding:
Java Class File  |  1995-10-12  |  900 b   |  18 lines

  1. import java.applet.Applet;
  2. import java.awt.Component;
  3. import java.awt.Graphics;
  4.  
  5. public class GraphApplet extends Applet {
  6.    // $FF: renamed from: f (double) double
  7.    double method_0(double x) {
  8.       return (Math.cos(x / (double)5.0F) + Math.sin(x / (double)7.0F) + (double)2.0F) * (double)((Component)this).size().height / (double)4.0F;
  9.    }
  10.  
  11.    public void paint(Graphics g) {
  12.       for(int x = 0; x < ((Component)this).size().width; ++x) {
  13.          g.drawLine(x, (int)this.method_0((double)x), x + 1, (int)this.method_0((double)(x + 1)));
  14.       }
  15.  
  16.    }
  17. }
  18.